﻿<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:include href="core\form.xsl"/>
<!-- 	<xsl:include href="core\layout_empty.xsl"/> -->
	<xsl:include href="core\level0.xsl"/>
	<xsl:include href="core\common_templates.xsl"/>

	<xsl:template match="page">
		<xsl:call-template name="page_content"/>
	</xsl:template>
	
	<xsl:template name="page_content">
		<table cellpadding="4" cellspacing="1" width="95%" align="center">
			<xsl:choose>
				<xsl:when test="string-length(/page/autherror)>0">
					<tr><td><xsl:apply-templates select="autherror"/></td></tr>
				</xsl:when>
				<xsl:otherwise>
					<tr>
						<td>
							<xsl:variable name="ves_name"><xsl:value-of select="/page/vessel_name"/></xsl:variable>
	 						<xsl:call-template name="page_navbar_email"/>
							<xsl:call-template name="title_page">
								<xsl:with-param name="titleText">Contact a Broker</xsl:with-param>
							</xsl:call-template>
											<xsl:if test="string-length(message)>0">
								<br/><br/><center><xsl:apply-templates select="message"/></center><br/><br/><br/>
							</xsl:if>
							<xsl:choose>
								<xsl:when test="//page/was_sent">
									<br/><br/><br/><br/>
								</xsl:when>
								<xsl:otherwise>
									<xsl:apply-templates select="form[@name='email']"/>
								</xsl:otherwise>
							</xsl:choose>
							<xsl:call-template name="page_navbar_email"/>
						</td>
					</tr>
				</xsl:otherwise>
			</xsl:choose>
		</table>
	</xsl:template>

	<xsl:template name="page_navbar_email">
		<table cellpadding="4" cellspacing="1" width="100%" align="center">
			<tr align="center">
				<td>
					<a class="linkbold" title="Return to Yacht List">
						<xsl:attribute name="href">
							<xsl:value-of select="//page/view_list_t"/>
						</xsl:attribute><font color="{$color_main_first1}">
						Return to Yacht List</font>
					</a>&#160;&#160;|&#160;<xsl:choose><xsl:when test="/page/theme = 1">
					<a href="main.asp?-vessel_basic_info.asp-&amp;vessels_id={/page/vessel_id}&amp;curr_id={//page/curr_id}&amp;vd=1" class="linkbold" title="Yacht ID#{/page/vessel_id} Basic Info"><font color="{$color_main_first1}">Yacht Basic Info</font></a></xsl:when><xsl:otherwise>					<a href="main.asp?-vessel_basic_info.asp-&amp;vessels_id={/page/vessel_id}&amp;curr_id={//page/curr_id}" class="linkbold" title="Yacht ID#{/page/vessel_id} Basic Info"><font color="{$color_main_first1}">Yacht Basic Info</font></a></xsl:otherwise></xsl:choose>&#160;&#160;|&#160;<xsl:choose><xsl:when test="/page/theme = 1"><a href="main.asp?-vessel_detail.asp-&amp;vessel_id={/page/vessel_id}&amp;curr_id={//page/curr_id}&amp;vd=1" class="linkbold" title="Yacht ID#{/page/vessel_id} Details"><font color="{$color_main_first1}">Yacht Details</font></a></xsl:when><xsl:otherwise><a href="main.asp?-vessel_detail.asp-&amp;vessel_id={/page/vessel_id}&amp;curr_id={//page/curr_id}" class="linkbold" title="Yacht ID#{/page/vessel_id} Details"><font color="{$color_main_first1}">Yacht Details</font></a></xsl:otherwise></xsl:choose>&#160;&#160;|&#160;
					<a href="#" title="Print Yacht ID#{/page/vessel_id} Listing" class="linkbold">
						<xsl:choose>
							<xsl:when test="//page/use_own_footer = 1">
								<xsl:attribute name="onClick">
									window.open('<xsl:value-of select="$media_path"/>/brochure_generate_1.asp?vessel_id=<xsl:value-of select="//page/vessel_id"/>&amp;CompanyID=<xsl:value-of select="//page/member_company_id"/>&amp;MemberID=<xsl:value-of select="//page/member_company_id"/>&amp;AccessLevel=<xsl:value-of select="//page/access_level"/>&amp;int_login_id=<xsl:value-of select="//page/login_id"/>&amp;blnPicInlude=<xsl:value-of select="//page/BrochurePreferences/blnPicInclude"/>&amp;blnPrintPageNumbers=<xsl:value-of select="//page/BrochurePreferences/blnPrintPageNumbers"/>&amp;blnPhotos=<xsl:value-of select="//page/BrochurePreferences/blnPhotos"/>&amp;blnNoImage=<xsl:value-of select="//page/BrochurePreferences/blnNoImage"/>&amp;blnOnePage=<xsl:value-of select="//page/BrochurePreferences/blnOnePage"/>&amp;blnQuality=1&amp;blnIncludeLogo=<xsl:value-of select="//page/BrochurePreferences/blnIncludeLogo"/>&amp;blnIncludeContact=5&amp;blnUseHFSpace=<xsl:value-of select="//page/BrochurePreferences/blnUseHFSpace"/>&amp;blnIncludeDetails=<xsl:value-of select="//page/BrochurePreferences/blnIncludeDetails"/>&amp;blnCoverInlude=<xsl:value-of select="//page/BrochurePreferences/blnCoverInlude"/>&amp;blnBrochuresLayOut=<xsl:value-of select="//page/BrochurePreferences/blnBrochuresLayOut"/>&amp;MainProfilePhotoOnly=<xsl:value-of select="//page/BrochurePreferences/blnMainProfileOnly"/>&amp;fldUserFontFace=<xsl:value-of select="//page/BrochurePreferences/blnFontName"/>&amp;fldUserFontSize=<xsl:value-of select="//page/BrochurePreferences/blnFontSize"/>&amp;blnLayout=<xsl:value-of select="//page/BrochurePreferences/blnLayout"/>&amp;intPaperSize=<xsl:value-of select="//page/BrochurePreferences/intPaperSize"/>&amp;OtherSalesman=-2&amp;curr_id=<xsl:value-of select = "//page/curr_id"/>&amp;measure_id=<xsl:value-of select = "//page/measure_id"/>&amp;ph=1&amp;print_full_listing=1&amp;template=1&amp;blnBrochureConsumer=1',null,'height=500,width=700,resizable=yes,scrollbars=yes')
								</xsl:attribute>
							</xsl:when>
							<xsl:otherwise>
								<xsl:attribute name="onClick">
									window.open('<xsl:value-of select="$media_path"/>/brochure_generate_1.asp?vessel_id=<xsl:value-of select="//page/vessel_id"/>&amp;CompanyID=<xsl:value-of select="//page/member_company_id"/>&amp;MemberID=<xsl:value-of select="//page/member_company_id"/>&amp;AccessLevel=<xsl:value-of select="//page/access_level"/>&amp;int_login_id=<xsl:value-of select="//page/login_id"/>&amp;blnPicInlude=<xsl:value-of select="//page/BrochurePreferences/blnPicInclude"/>&amp;blnPrintPageNumbers=<xsl:value-of select="//page/BrochurePreferences/blnPrintPageNumbers"/>&amp;blnPhotos=<xsl:value-of select="//page/BrochurePreferences/blnPhotos"/>&amp;blnNoImage=<xsl:value-of select="//page/BrochurePreferences/blnNoImage"/>&amp;blnOnePage=<xsl:value-of select="//page/BrochurePreferences/blnOnePage"/>&amp;blnQuality=1&amp;blnIncludeLogo=<xsl:value-of select="//page/BrochurePreferences/blnIncludeLogo"/>&amp;blnIncludeContact=<xsl:value-of select="//page/BrochurePreferences/blnIncludeContact"/>&amp;blnUseHFSpace=<xsl:value-of select="//page/BrochurePreferences/blnUseHFSpace"/>&amp;blnIncludeDetails=<xsl:value-of select="//page/BrochurePreferences/blnIncludeDetails"/>&amp;blnCoverInlude=<xsl:value-of select="//page/BrochurePreferences/blnCoverInlude"/>&amp;blnBrochuresLayOut=<xsl:value-of select="//page/BrochurePreferences/blnBrochuresLayOut"/>&amp;MainProfilePhotoOnly=<xsl:value-of select="//page/BrochurePreferences/blnMainProfileOnly"/>&amp;fldUserFontFace=<xsl:value-of select="//page/BrochurePreferences/blnFontName"/>&amp;fldUserFontSize=<xsl:value-of select="//page/BrochurePreferences/blnFontSize"/>&amp;blnLayout=<xsl:value-of select="//page/BrochurePreferences/blnLayout"/>&amp;intPaperSize=<xsl:value-of select="//page/BrochurePreferences/intPaperSize"/>&amp;OtherSalesman=-2&amp;curr_id=<xsl:value-of select = "//page/curr_id"/>&amp;measure_id=<xsl:value-of select = "//page/measure_id"/>&amp;ph=1&amp;print_full_listing=1&amp;template=1&amp;blnBrochureConsumer=1',null,'height=500,width=700,resizable=yes,scrollbars=yes')
								</xsl:attribute>
							</xsl:otherwise>
						</xsl:choose>
						<font color="{$color_main_first1}">Print Listing</font>
					</a>&#160;&#160;|&#160;
					<font class="imagetitle">Contact Us</font><br/>
					<xsl:if test="/page/vessel/show_view_photos_link">
						<a href="#" title="Yacht ID#{/page/vessel_id} Photos" class="linkbold">
							<xsl:attribute name="onClick">
								window.open('main.asp?-vessel_photos.asp-fvessel_id=<xsl:value-of select="/page/vessel_id"/>',null,'height=500,width=600,resizable=yes,scrollbars=yes')
							</xsl:attribute><font color="{$color_main_first1}">Yacht Photos</font>
						</a>
						<xsl:if test="/page/vessel/show_view_vr_tours_link or /page/vessel/show_view_asf_link">
						&#160;&#160;|&#160;
						</xsl:if>
					</xsl:if>
					<xsl:if test="/page/vessel/show_view_vr_tours_link">
						<a href="#" title="Yacht ID#{/page/vessel_id} VR Tour" class="linkbold">
							<xsl:attribute name="onClick">
								window.open('main.asp?-preview_ivr.asp-fvessel_id=<xsl:value-of select="/page/vessel_id"/>',null,'height=500,width=600,resizable=yes,scrollbars=yes')
							</xsl:attribute><font color="{$color_main_first1}">Yacht VR Tour</font>
						</a><xsl:if test="/page/vessel/show_view_asf_link">&#160;&#160;|&#160;</xsl:if>
					</xsl:if>
					<xsl:if test="/page/vessel/show_view_asf_link">
						<a href="#" title="Yacht ID#{/page/vessel_id} Streaming Video" class="linkbold">
							<xsl:attribute name="onClick">
								window.open('main.asp?-preview_asf.asp-fvessel_id=<xsl:value-of select="/page/vessel_id"/>',null,'height=500,width=600,resizable=yes,scrollbars=yes')
							</xsl:attribute><font color="{$color_main_first1}">Yacht Streaming Video</font>
						</a>
					</xsl:if>					
				</td>
			</tr>
		</table>
	</xsl:template>

	<xsl:template match="message">
		<b><font color="#ff0000"><xsl:value-of select="." disable-output-escaping="yes"/></font></b>
	</xsl:template>

	<xsl:template match="form[@name='email']">
		<form action="main.asp">
			<input type="Hidden" name="-email_send.asp-"/>
			<xsl:copy-of select="@*"/>
			<xsl:apply-templates select="control/input[@type='hidden']"/>
			<table cellpadding="2" cellspacing="2" align="center">
				<tr>
					<td class="titleblack" align="center" valign="top">
						<table cellpadding="2" cellspacing="2">
							<xsl:if test="//page/view_offices_email = 1">
								<tr>
									<td colspan="3" class="titleblack">
										<font class="imagetitle">Please choose the office wher you would like to send the leads:</font><br/>
										<xsl:apply-templates select="control[@name='office_email']"/><br/><br/>
									</td>
								</tr>
							</xsl:if>
							<tr>
								<td colspan="3" class="imagetitle">Please fill out the information below. All items marked "<font color="red">*</font>" are required entries.</td>
							</tr>
							<tr>
								<td class="titleblack" valign="bottom"><strong>First Name</strong><font color="red">*</font><br/><xsl:apply-templates select="control[@name='FirstName']/input"/></td>
								<td>&#160;&#160;&#160;</td>
								<td class="titleblack" valign="bottom"><xsl:apply-templates select="control[@name='LastName']"/></td>
							</tr>
							<tr>
								<td class="titleblack" valign="bottom"><xsl:apply-templates select="control[@name='HomePhone']"/></td>
								<td>&#160;&#160;&#160;</td>
								<td class="titleblack" valign="bottom"><xsl:apply-templates select="control[@name='WorkPhone']"/></td>
							</tr>
							<tr>
								<td class="titleblack" valign="bottom" colspan="3"><strong>Email<font color="red">*</font></strong><br/>

									<xsl:apply-templates select="control[@name='EmailFrom']/input"/>
									&#160;&#160;<xsl:apply-templates select="control[@name='send_request']"/>
								</td>
							</tr>
							<tr>
								<td class="titleblack" valign="bottom" colspan="3">
									<xsl:apply-templates select="control[@name='Comments']"/>
								</td>
							</tr>
						</table>
					</td>
					<!--< td background="{$img_path_templates}/hr_vert_grey.gif" width="1" rowspan="1">
						<img src="{$img_path_templates}/spacer.gif" alt="" width="2" height="20" border="0"/>
					</td> -->
				</tr>
				<tr>
					<td colspan="3" align="center">
						<input type="image" src="{$img_path_templates}/{$header_bg_color}/buttons/btn_email.gif" value="EmailSend" name="EmailSend" border="0"/>
					</td>
				</tr>
			</table>
			<!-- <br/>
			<hr width="80%" size="1" noshade="true" color="#CCCCCC"/> -->
		</form>
	</xsl:template>

	<xsl:template match="control[@name='send_request']">
		<xsl:apply-templates select="input">
			<xsl:with-param name="size_default">15</xsl:with-param>
		</xsl:apply-templates>
		Request a Return Receipt
	</xsl:template>
</xsl:stylesheet>
